'''
Created on 15 mai 2009

@author: tmeedendorp
'''

def getDictionaryFromFile(filename):
    propFile= file( r"C:\Java\jdk1.5.0_06\jre\lib\logging.properties", "rU" )
    propDict= dict()
    for propLine in propFile:
        propDef= propLine.strip()
        if len(propDef) == 0:
            continue
        if propDef[0] in ( '!', '#' ):
            continue
        punctuation= [ propDef.find(c) for c in ':= ' ] + [ len(propDef) ]
        found= min( [ pos for pos in punctuation if pos != -1 ] )
        name= propDef[:found].rstrip()
        value= propDef[found:].lstrip(":= ").rstrip()
        propDict[name]= value
        propFile.close()
        print propDict
        print propDict['handlers']